package com.wei.web.demo.user.security;

import com.wei.web.demo.user.security.model.DummyAuthentication;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;

public class DummyAuthenticationProvider implements AuthenticationProvider {
    @Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        return authentication;
    }

    @Override
    public boolean supports(Class<?> authentication) {
        if (authentication.isAssignableFrom(DummyAuthentication.class)) {
            return true;
        }
        return false;
    }
}
